package com.ruoyi.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;

@Data
@TableName("projects") // 指定数据库表名
public class Project {

    @TableId(type = IdType.AUTO) // 主键自增
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @Length(max = 255, message = "项目标题不能超过50个字符")
    private String title;

    private Integer status; // 0 未启用 1 启用

    private String contentTitle;

    private String introTitle;

    private String introDescription;

    private String introHighlight1;

    private String introMiddleText;

    private String introHighlight2;

    private String introEndText;

    private String catalogTitle;

    private String resourceUrl;
    @Length(max = 50, message = "项目标签不能超过50个字符")
    private String tag;

    private String img;

    @TableField(fill = FieldFill.INSERT) // 插入时填充
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE) // 插入和更新时填充
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;
}